//package org.penguin.study.bk.advice
//
//import org.springframework.core.Ordered
//import org.springframework.core.annotation.Order
//import org.springframework.http.HttpHeaders
//import org.springframework.http.HttpStatus
//import org.springframework.http.ResponseEntity
//import org.springframework.web.bind.annotation.ControllerAdvice
//import org.springframework.web.bind.annotation.ExceptionHandler
//import org.springframework.web.context.request.WebRequest
//import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
//import javax.validation.ConstraintViolationException
//
///**
// * 优先级别高，和ExceptionHandler存在冲突
// */
//@Order(Ordered.LOWEST_PRECEDENCE)
//@ControllerAdvice
//class ConstraintViolationExceptionHandler : ResponseEntityExceptionHandler() {
//    @ExceptionHandler(value = [ConstraintViolationException::class])
//    protected fun handleConstraintViolation(
//        e: ConstraintViolationException,
//        request: WebRequest
//    ): ResponseEntity<Any> {
//        return handleExceptionInternal(e, e.message, HttpHeaders(), HttpStatus.BAD_REQUEST, request)
//    }
//}